package cn.lcc.utils.watch;

import cn.lcc.utils.core.enums.ParserPackConst;
import hy.iot.core.annotation.IotField;
import hy.iot.core.annotation.IotFieldClass;
import hy.iot.core.entity.IMessage;

@IotFieldClass(hexValueOptions = "[*]",parseSchema = ParserPackConst.HEX_TO_STRING)
public class WatchHeader implements IMessage {

    @IotField(desc = "数据标识符",parseSchema = ParserPackConst.HEX_TO_HEX,hexStart = 0)
    public String messageMark;

    @IotField(desc = "设备ID",parseSchema = ParserPackConst.HEX_TO_HEX,hexStart = 1)
    public String deviceId;
    /**
     * 4445 2c
     */
    @IotField(desc = "数据长度",parseSchema = ParserPackConst.HEX_TO_TEN,hexStart = 2)
    public int dataLen;
    /**
     * 4445 2c
     */
    @IotField(desc = "点位类型",parseSchema = ParserPackConst.HEX_TO_HEX,hexStart = 3 ,hexValueOptions = ",",hexValueIndex = 0)
    public String pointType;
    /**
     * 4445 2c 44454d4f 2c
     */
    @IotField(desc = "数据",parseSchema = ParserPackConst.HEX_TO_HEX,hexStart = 3)
    public String data;

    @Override
    public String getClientId() {
        return deviceId;
    }

    @Override
    public String getMessageId() {
        return pointType;
    }

    @Override
    public String getVersion() {
        return "0";
    }

    @Override
    public String getPointType() {
        return this.pointType;
    }
}
